package com.CGFrame.struts.action.message;

import java.util.HashSet;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import com.CGFrame.struts.bean.project.ProjectBean;
import com.CGFrame.struts.bean.sector.SectorBean;

public class UserInProjectAction extends Action {

	@Override
	public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
		String projectId=request.getParameter("projectId");
		String sectorId=request.getParameter("sectorId");
		if(projectId!=null){
			ProjectBean pb=new ProjectBean(projectId);
			HashSet set=pb.getEmployeeNameInProject();
			request.setAttribute("empNameSet", set);
		}
		if(sectorId!=null){
	//		System.out.println("User Action Sector!!");
			SectorBean sb=new SectorBean();
			HashSet set=sb.getEmployeeNameBySectorId(sectorId);
			request.setAttribute("empNameSet", set);
		}
		return mapping.findForward("usermiddle");
	}
	
}
